#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "DirectedRelationship.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class ProtocolStateMachine;

/// <summary>
/// ProtocolConformance
/// A ProtocolStateMachine can be redefined into a more specific
/// ProtocolStateMachine or into behavioral StateMachine. ProtocolConformance
/// declares that the specific ProtocolStateMachine specifies a protocol that
/// conforms to the general ProtocolStateMachine or that the specific behavioral
/// StateMachine abides by the protocol of the general ProtocolStateMachine.
/// </summary>
class UMLMODEL_EXPORT ProtocolConformance : public DirectedRelationship {

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// generalMachine getter
    /// Specifies the ProtocolStateMachine to which the specific ProtocolStateMachine
    /// conforms.
    /// </summary>
    shared_ptr<ProtocolStateMachine> generalMachine() const;

    /// <summary>
    /// generalMachine setter
    /// Specifies the ProtocolStateMachine to which the specific ProtocolStateMachine
    /// conforms.
    /// </summary>
    void setGeneralMachine(shared_ptr<ProtocolStateMachine> value);

    /// <summary>
    /// specificMachine getter
    /// Specifies the ProtocolStateMachine which conforms to the general
    /// ProtocolStateMachine.
    /// </summary>
    shared_ptr<ProtocolStateMachine> specificMachine() const;

    /// <summary>
    /// specificMachine setter
    /// Specifies the ProtocolStateMachine which conforms to the general
    /// ProtocolStateMachine.
    /// </summary>
    void setSpecificMachine(shared_ptr<ProtocolStateMachine> value);

private: // Fields
    /// <summary>
    /// generalMachine
    /// Specifies the ProtocolStateMachine to which the specific ProtocolStateMachine
    /// conforms.
    /// </summary>
    shared_ptr<ProtocolStateMachine> generalMachine_;

    /// <summary>
    /// specificMachine
    /// Specifies the ProtocolStateMachine which conforms to the general
    /// ProtocolStateMachine.
    /// </summary>
    shared_ptr<ProtocolStateMachine> specificMachine_;

};

} // namespace uml
